package xyz.jangle.design.memento;

public class Originator {
	
	int state;
	
	Memento createMemento() {
		Memento memento = new Memento();
		memento.setState(state);
		return memento;
	}
	
	void restoreFromMemento(Memento memento) {
		state = memento.getState();
	}
	
	void useState(){
		state++;
	}

}
